/*
 * Copyright (C) 2017-2021
 * All rights reserved, Designed By
 * Copyright authorization contact 18814114118
 */
package com.shop.cereshop.app.page.collect;

import com.shop.cereshop.commons.domain.calculate.Calculate;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 足迹商品数据
 */
@Data
@ApiModel(value = "FootprintProduct", description = "足迹商品数据")
public class FootprintProduct {

    /**
     * 足迹id
     */
    @ApiModelProperty(value = "足迹id")
    private Long footprintId;

    /**
     * 店铺id
     */
    @ApiModelProperty(value = "店铺id")
    private Long shopId;

    /**
     * 商品简介
     */
    @ApiModelProperty(value = "商品简介")
    private String productBrief;

    /**
     * 虚拟销量
     */
    @ApiModelProperty(value = "虚拟销量")
    private Integer fictitiousNumber;

    /**
     * 商品实际销量
     */
    @ApiModelProperty(value = "商品实际销量")
    private Integer salesVolume;
    /**
     * 商品总销量
     */
    @ApiModelProperty(value = "商品总销量")
    private Integer totalSalesVolume;

    /**
     *店铺名称
     */
    @ApiModelProperty(value = "店铺名称")
    private String shopName;

    /**
     * 店铺省
     */
    @ApiModelProperty(value = "店铺省")
    private String shopAdressProvince;

    /**
     * 店铺市
     */
    @ApiModelProperty(value = "店铺市")
    private String shopAdressCity;
    /**
     * 店铺详细地址
     */
    @ApiModelProperty(value = "店铺详细地址")
    private String shopAdressDetail;

    @ApiModelProperty(value = "店铺类型,主体类型 1-普通企业店 2-个体工商户3-品牌旗舰店 4-其他组织")
     private Integer  authenType;

    @ApiModelProperty("商品平均分")
      Float avgScore;
    /**
     * 商品标签
     */
    @ApiModelProperty(value = "商品标签")
    private List<String> productLabels;

    public void setProductLabels( Calculate calculate) {
        List<String> list = new ArrayList<>();

        if (calculate.getShopAllWeekToUer() != null && 1 == calculate.getShopAllWeekToUer()) {
            list.add("全周可用");
        }
        if (calculate.getShopGoodLikeWater() != null && 1 == calculate.getShopGoodLikeWater()) {
            list.add("好评如潮");
        }
        if (calculate.getHotProduct() != null && 1 == calculate.getHotProduct()) {
            list.add("热销商品");
        }
        if (calculate.getPriceGood()!= null && 1 == calculate.getPriceGood()){
            list.add("价格实惠");
        }



        this.productLabels = list;
    }




    public void setTotalSalesVolume(Integer salesVolume,Integer fictitiousNumber) {
        this.totalSalesVolume = salesVolume+fictitiousNumber;
    }

    /**
     * 商品id
     */
    @ApiModelProperty(value = "商品id")
    private Long productId;

    /**
     * 规格id
     */
    @ApiModelProperty(value = "规格id")
    private Long skuId;

    /**
     * 商品图片
     */
    @ApiModelProperty(value = "商品图片")
    private String image;

    /**
     * 商品名称
     */
    @ApiModelProperty(value = "商品名称")
    private String productName;

    /**
     * 商品售价
     */
    @ApiModelProperty(value = "商品售价")
    private BigDecimal price;

    /**
     * 商品原价
     */
    @ApiModelProperty(value = "商品原价")
    private BigDecimal originalPrice;

    /**
     * 商品分类
     */
    @ApiModelProperty(value = "商品分类,910-线上商城,908-同城服务,929同城配送")
    private Integer classifyId2;

    /**
     * 是否上架 1-上架 0-不上架
     */
    @ApiModelProperty(value = "是否上架 1-上架 0-不上架")
    private Integer shelveState;

    /**
     * 是否选中 1-是 0-否
     */
    @ApiModelProperty(value = "是否选中 1-是 0-否")
    private Integer selected;

    /**
     * 活动类型
     */
    @ApiModelProperty(value = "活动类型")
    private Integer activityType;

    /**
     * show
     */
    private boolean show=false;
}
